string permutations iterative solution

join shbcf.ru